from smtplib import SMTP
from email.header import Header
from email.mime.text import MIMEText
import heapq
from collections import Counter

"""
找出序列中出现次数最多的元素
Counter().most_common()
"""


def send_email():
    # 请自行修改下面的邮件发送者和接收者
    sender = '965412472@qq.com'
    receivers = ['zhangfuhao@clearofchina.com']
    message = MIMEText('用Python发送邮件的示例代码.', 'plain', 'utf-8')
    message['From'] = Header('王大锤', 'utf-8')
    message['To'] = Header('骆昊', 'utf-8')
    message['Subject'] = Header('示例代码实验邮件', 'utf-8')
    smtper = SMTP('smtp.qq.com')
    # 请自行修改下面的登录口令
    smtper.login(sender, 'a728245788')
    smtper.sendmail(sender, receivers, message.as_string())
    print('邮件发送完成!')


"""
从列表中找出最大的或最小的N个元素
堆结构(大根堆/小根堆)
heapq.nlargest
heapq.nsmallest
"""


